import * as types from './types'
import getters from './getters'

const state = {
  direction: 'forward',
  /*首页数据保留*/
  homeStateData: [],
  /*登录状态*/
  loginStatus: false,
  /*帮助中心、个人中心面包屑导航数据*/
  breadcrumbData:[
    // {name: '首页', routeName: 'index'},
  ],
  /*用户信息*/
  userInformation: '',
  /*累計獎金*/
  prize: {},
  /*页面滚动位置*/
  pageScroolTop:0,
  /*所有彩种列表*/
  allLotteryListData:{
    tradition:[],//传统彩票
    recreation:[],//娱乐彩票
  },
  /*彩种数据*/
  recordColorData: {
    0: {data: []}, 1: {data: []}, 2: {data: []}, 3: {data: []}, 4: {data: []}, 5: {data: []}, 6: {data: []},
    7: {data: []}, 8: {data: []}, 9: {data: []}, 10: {data: []}, 11: {data: []}, 12: {data: []}, 13: {data: []},
    14: {data: []}, 15: {data: []}, 16: {data: []}, 17: {data: []}, 18: {data: []}, 19: {data: []}, 20: {data: []},21: {data: []},22: {data: []},23: {data: []},24: {data: []},25: {data: []},26: {data: []}, 1001: {data: []},1002:{data:[]},1003:{data:[]},2001:{data:[]},2002:{data:[]}
  },
  /*保留封盘状态*/
  bottomPourData: false, //是否封盘
  //保留初始化数据
  initLotteryData: {},
  //保留之前封盘的信息
  sealingPlateOld: {},
  /*messageBox内容*/
  messageBoxInfo:{
    title:'',
    content:[],
  },
  /*抽奖开启状态*/
  luckyStatus:false,
  /*电游开关*/
  fgGameStatus:false,
  /*开奖历史数据*/
  hisRewData:[],
};

const mutations = {
  [types.UPDATE_DIRECTION](state, payload) {
    state.direction = payload.direction
  },
  [types.HOME_STATE_DATA](state, payload) {
    state.homeStateData = payload
  },
  [types.POST_LOGIN_STATUS](state, payload) {
    state.loginStatus = payload.loginStatus
  },
  [types.BREADCRUMB_DATA](state, payload) {
    state.breadcrumbData = payload;
  },
  [types.POST_USER_INFORMATION](state, payload) {
    state.userInformation = payload;
  },
  [types.PAGE_SCROOL_TOP](state, payload) {
    state.pageScroolTop = payload;
  },
  //彩种数据 recordColorData
  [types.RECORD_COLOR_DATA](state, payload) {
    state.recordColorData[payload.id].data = payload.data;
  },
  //封盘状态
  [types.BOTTOM_POUR_DATA](state, payload) {
    state.bottomPourData = payload
  },
  //保留提交数据
  [types.INIT_LOTTERY_DATA](state, payload) {
    state.initLotteryData = payload;
  },
  //sealingPlateOld
  [types.SEALING_PLATE_OLD_DATA](state, payload) {
    state.sealingPlateOld = payload;
  },
  //所有彩种列表
  [types.ALL_LOTTERY_LIST_DATA](state, payload) {
    state.allLotteryListData = payload;
  },
  //累計獎金
  [types.PRIZE](state, payload) {
    state.prize = payload;
  },
  //抽奖开启状态
  [types.LUCKY_STATUS](state, payload) {
    state.luckyStatus = payload;
  },
  //开奖历史数据
  [types.HIS_REW_DATA](state, payload) {
    state.hisRewData = payload;
  },
  //messageBox内容
  [types.MESSAGE_BOX_INFO](state, payload) {
    state.messageBoxInfo = payload
  },
  //电游开关
  [types.FG_GAME_STATUS](state, payload) {
    state.fgGameStatus = payload
  }
};

export default {
  state,
  mutations,
  getters
}
